package com.topway.ws.server;

import javax.xml.ws.Endpoint;

import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

import com.topway.ws.service.impl.HelloServiceImpl;

public class StartServer {

	public static void main(String[] args) {
		// method 1
		// http://127.0.0.1:8080/cxfSoap/service/helloService?wsdl
		Endpoint.publish("http://127.0.0.1:8080/cxfSoap/service/helloService", new HelloServiceImpl());

		// method 2
		JaxWsServerFactoryBean jws = new JaxWsServerFactoryBean();

		jws.setAddress("http://127.0.0.1:8080/cxfSoap/service/helloService?wsdl");
		jws.setServiceBean(new HelloServiceImpl());
		jws.create();
	}
}
